<?php
class WebsiteObjModel extends Model {
	
	public function getWebsiteById($id) {
		$queryString = sprintf("
			SELECT 
				*
			FROM
				`website`
			WHERE
				`website`.`id` = %d;
		", $id 
		);
		$result = $this->_sqlInstance->query($queryString);
		return $result;
	}
	
	
	public function save(Website $website) {
		$queryString = sprintf("
			INSERT INTO
				`website`(`id_user`, `name`, `url`)
			VALUES
				(%d, '%s', '%s');
		",$website->userId, $website->name, $website->url);
		$this->_sqlInstance->query($queryString);
	}
}